package com.drm.netschool.mapper;

import com.drm.netschool.entity.DrmSalesPromotion;
import com.drm.netschool.entity.DrmSalesPromotionExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmSalesPromotionMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    int countByExample(DrmSalesPromotionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    int deleteByExample(DrmSalesPromotionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    @Delete({
        "delete from drm_sales_promotion",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    @Insert({
        "insert into drm_sales_promotion (id, promotion_tp, ",
        "promotion_sdt, promotion_edt, ",
        "promotion_money, reduce_money, ",
        "use_yn)",
        "values (#{id,jdbcType=INTEGER}, #{promotionTp,jdbcType=INTEGER}, ",
        "#{promotionSdt,jdbcType=TIMESTAMP}, #{promotionEdt,jdbcType=TIMESTAMP}, ",
        "#{promotionMoney,jdbcType=BIGINT}, #{reduceMoney,jdbcType=BIGINT}, ",
        "#{useYn,jdbcType=INTEGER})"
    })
    int insert(DrmSalesPromotion record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    int insertSelective(DrmSalesPromotion record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    List<DrmSalesPromotion> selectByExample(DrmSalesPromotionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    @Select({
        "select",
        "id, promotion_tp, promotion_sdt, promotion_edt, promotion_money, reduce_money, ",
        "use_yn",
        "from drm_sales_promotion",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    DrmSalesPromotion selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmSalesPromotion record, @Param("example") DrmSalesPromotionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    int updateByExample(@Param("record") DrmSalesPromotion record, @Param("example") DrmSalesPromotionExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    int updateByPrimaryKeySelective(DrmSalesPromotion record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_sales_promotion
     *
     * @mbggenerated Fri Aug 07 09:40:46 CST 2015
     */
    @Update({
        "update drm_sales_promotion",
        "set promotion_tp = #{promotionTp,jdbcType=INTEGER},",
          "promotion_sdt = #{promotionSdt,jdbcType=TIMESTAMP},",
          "promotion_edt = #{promotionEdt,jdbcType=TIMESTAMP},",
          "promotion_money = #{promotionMoney,jdbcType=BIGINT},",
          "reduce_money = #{reduceMoney,jdbcType=BIGINT},",
          "use_yn = #{useYn,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DrmSalesPromotion record);
}